Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Using session super procedures
In addition to associating super procedures with a specific object procedure, you can also add them to the entire OpenEdge session so that every procedure that executes in the session can take advantage of them. You do this by executing the
ADD-SUPER-PROCEDUREmethod from theSESSIONhandle:
The search order the interpreter uses to locate internal procedures and functions now becomes this:
- The procedure file the routine is run in (that is, either the procedure that actually contains the
RUNstatement or function reference or, if you use theRUN INsyntax or theDYNAMIC-FUNCTION . . . INsyntax, the procedure handle following theINkeyword).- Super procedures added to that procedure handle, starting with the last one added.
- Super procedures added to the
SESSIONhandle, starting with the last one added.In addition, in the case of a
RUNstatement, if an internal procedure of that name is not located anywhere, the final step of the search is for a compiled external procedure (.rfile) of that name.You should exercise caution when adding super procedures to the session, precisely because their contents become available to absolutely every procedure run in the session. Nevertheless, this technique can be effective in some cases, especially for extending the behavior of existing application procedures without having to edit them to put in
ADD-SUPER-PROCEDUREstatements. If the existing procedure was originally intended to run a compiled external procedure (.rfile) and does not explicitly include the.por.rextension on the filename reference in theRUNstatement, then the external.rfile can be replaced by a session super procedure that contains an internal procedure of the same name. This changes the behavior of the application without making any changes whatsoever to the existing application files (not even recompiling them).
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |